package br.com.io.streams;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.text.DateFormat;
import java.util.Date;

public class EscreverArquivo {
	public static void main(String[] args) {
			
		try {
			DateFormat df = DateFormat.getDateInstance(DateFormat.LONG);
			
			FileOutputStream fos = new FileOutputStream(new File("arquivo.txt"),true);
			BufferedOutputStream bos = new BufferedOutputStream(fos);

			bos.write('\n');
			bos.write(df.format(new Date()).toString().getBytes());

			bos.close();
		} catch (FileNotFoundException e) {
			// TODO: handle exception
		}
		catch (IOException e){
			
		}
		
		
	}
}
